//*****************************************************************************
//  C++: HW6 
//  Shragay Dror (ID:038778445)
//  Zilber Jenia (ID:313975492)
//*****************************************************************************

#include "Meeting.h"
#include "Day.h"
#include "Diary.h"
#include "MeetingFactory.h" 
 
int main()
{
	vector<string> prtcp;
	prtcp.push_back("A");
	prtcp.push_back("B");
	prtcp.push_back("C");

	string day = "Sunday";
	string sbj = "Poker party";
	
	int sH = 10;
	int sM = 50;
	int eH = 11;
	int eM = 0;
//********************************
	vector<string> prtcp2;
	prtcp2.push_back("D");
	prtcp2.push_back("E");
	prtcp2.push_back("F");
	
	string day2 = "Wednesday";
	string sbj2 = "Poker party";
	
	int sH2 = 18;
	int sM2 = 33;
	int eH2 = 23;
	int eM2 = 0;

	//********************************
	vector<string> prtcp3;
	prtcp3.push_back("A");
	prtcp3.push_back("E");
	
	string day3 = "Wednesday";
	string sbj3 = "Poker party";
	
	int sH3 = 15;
	int sM3 = 50;
	int eH3 = 16;
	int eM3 = 0;
    
	//********************************
	vector<string> prtcp4;
	prtcp4.push_back("Jojo");

	//********************************
	vector<string> prtcp5;
	prtcp5.push_back("A");
	prtcp5.push_back("A");

	
	Diary* d = Diary::createObj();
	// Add meetings to diary
	(*d).addMeetingToDiary("job",prtcp,sbj,day,24,0,0,0);    // wrong hour
	(*d).addMeetingToDiary("job",prtcp,sbj,day,0,0,0,-1);    // wrong minute
	(*d).addMeetingToDiary("job",prtcp,sbj,day,10,10,10,9);  // start time after end time
	(*d).addMeetingToDiary("pleasure",prtcp,sbj,"Holiday",sH,sM,eH,eM);  // illegal day
	(*d).addMeetingToDiary("pleasure",prtcp4,sbj,day,sH,sM,eH,eM);  // illegal participators
	(*d).addMeetingToDiary("pleasure",prtcp5,sbj,day,sH,sM,eH,eM);  // illegal participators

	(*d).addMeetingToDiary("pleasure",prtcp,sbj,day,sH,sM,eH,eM);
	(*d).addMeetingToDiary("job",prtcp2,sbj2,day2,sH2,sM2,eH2,eM2);
	(*d).addMeetingToDiary("job",prtcp3,sbj3,day3,sH3,sM3,eH3,eM3);

	// Find meeting
	Meeting* meet = (*d).findMeetingInDiary(day,sH,sM); 
	Meeting* meet2 = (*d).findMeetingInDiary(day2,sH2,sM2); 
	Meeting* meet3 = (*d).findMeetingInDiary(day3,sH3,sM3); 

	// Delete meeting
	(*d).deleteMeetingFromDiary(meet);

	// Change time of meeting
	(*d).changeMeetingTime(meet3,day,sH,sM,eH,eM);


	// Add meeting that intersact with existing meeting
	(*d).addMeetingToDiary("pleasure",prtcp,sbj,day,sH,sM,eH,eM);
	(*d).addMeetingToDiary("pleasure",prtcp,sbj,day,10,59,11,0);

	// Change time of meeting
	meet = (*d).findMeetingInDiary(day,sH,sM); 
	(*d).changeMeetingTime(meet,day,10,59,11,0);
	(*d).addMeetingToDiary("pleasure",prtcp,sbj,day,9,58,10,9);

	(*d).printOut();

	Diary::Destroy();
	
	
} 
